<html>

<head>
    <link rel="stylesheet" href="style.css">
    <style></style>
</head>

<body>
    <div class="col">
        <h2>镜像效果</h2>

        <!---->
        <p>
            <pre>镜像输入合成/图像。
        
水平镜像一半，垂直镜像一半或镜像图像的四分之一。</pre>
        </p>
        <h4>属性</h4>
        <hr>
        <!---->
        <dl>
            <dt>通用元素属性</dt>
            <dd>
                <p>参见 <a href="local://customization_general">通用属性</a>。</p>
            </dd>

            <hr>

            <dt id="TargetImage">目标图像/图层</dt>
            <dd>
                <p>指定用作输入的图像或合成。</p>
            </dd>
            <dt id="mirrorMode">镜像模式</dt>
            <dd>
                <p>指定要镜像哪部分。（例如水平或垂直）</p>
            </dd>
            <dt id="flipMirror">翻转镜像</dt>
            <dd>
                <p>翻转边缘，将左侧或右侧翻转以进行镜像。</p>
            </dd>
            <dt id="color">颜色</dt>
            <dd>
                <p>效果的色调。</p>
            </dd>
        </dl>
    </div>



    <style media="screen" type="text/css">
        .container {
            width: 100%;
        }

        .container div {
            width: 100%;
        }

        .container .header {
            padding: 2px;
            cursor: pointer;
        }

        .container .content {
            display: none;
        }
    </style>


</body>
<script>
    // 获取当前页面的 URL
    const url = window.location.href;
    
    // 查找 URL 中的片段标识符
    const fragmentIndex = url.indexOf('#');
    
    if (fragmentIndex !== -1) {
        // 提取片段标识符后的内容
        const targets = decodeURI(url.substring(fragmentIndex + 1)).split(' ');
        for (const value of targets) {
            let target = document.getElementById(value)
            target.classList.remove('blink')
            target.classList.add('blink')
            setTimeout(() => target.classList.remove('blink'), 1400)
            if (index == 0)
                target.scrollIntoView()
        }
    
    } else {
        console.log('No fragment in URL.');
    }
    function isElementInViewport(element) {
        const rect = element.getBoundingClientRect();
        return (
          rect.top >= 0 &&
          rect.left >= 0 &&
          rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
          rect.right <= (window.innerWidth || document.documentElement.clientWidth)
        );
      }
    
    var hide
    
    for (const value of document.querySelectorAll('property')) {
        value.addEventListener('click', (event) => {
            let top = document.body.scrollTop
            console.log(top)
            document.querySelector('.back').classList.remove('hide')
            clearTimeout(hide)
            hide = setTimeout(() => document.querySelector('.back').classList.add('hide'), 5000)
            document.querySelector('.back').addEventListener('click', () => {
                document.body.scrollTop = top
                document.querySelector('.back').classList.add('hide')
            })  
    
            let ids = event.target.getAttribute('query').split(' ')
            for (let index = 0; index < ids.length; index++) {
                const id = ids[index];
                let target = document.getElementById(id)
                target.classList.remove('blink')
                target.classList.add('blink')
                setTimeout(() => target.classList.remove('blink'), 1400)
                if (index == 0&&!isElementInViewport(target))
                    target.scrollIntoView()
            }
        })
    }</script>
</html>